<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Round Display Level 1</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="exploring" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="This document describes CSS extensions to support a round display. The extensions help web authors to build a web page suitable for a round display." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://www.w3.org/TR/css-round-display-1/" rel="canonical">
<script defer src="https://test.csswg.org/harness/annotate.js#!css-round-display-1_dev/css-round-display-1" type="text/javascript"></script>
<style>
/* example in table layout*/
.example-table {
	display:table; 
	margin: 0 auto 1em; 
	border-spacing: 2em 0; 
	min-width: 672px;
}
.example-table > .desc {
	display: table-cell;
	vertical-align: top;
	width: 250px;
	text-align: center;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */

.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Round Display Level 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-round-display/">https://drafts.csswg.org/css-round-display/</a>
      <dt>Latest published version:
      <dd><a href="https://www.w3.org/TR/css-round-display-1/">https://www.w3.org/TR/css-round-display-1/</a>
      <dt>Previous Versions:
      <dd><a href="https://www.w3.org/TR/2016/WD-css-round-display-1-20161222/" rel="prev">https://www.w3.org/TR/2016/WD-css-round-display-1-20161222/</a>
      <dd><a href="https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/" rel="prev">https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/</a>
      <dd><a href="https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/" rel="prev">https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/</a>
      <dt>Test Suite:
      <dd><a href="http://test.csswg.org/suites/css-round-display-1_dev/nightly-unstable/">http://test.csswg.org/suites/css-round-display-1_dev/nightly-unstable/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="54503"><a class="p-name fn u-email email" href="mailto:hyojin22.song@lge.com">Hyojin Song</a> (<span class="p-org org">LG Electronics</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="79168"><a class="p-name fn u-email email" href="mailto:jh.hong@lge.com">Jihye Hong</a> (<span class="p-org org">LG Electronics</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="45470"><a class="p-name fn u-email email" href="mailto:soonbo.han@lge.com">Soonbo Han (until June 2015)</a> (<span class="p-org org">LG Electronics</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-round-display-1/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-round-display-1">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This document describes CSS extensions to support a round display. The extensions help web authors to build a web page suitable for a round display.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-round-display” in the title,
	preferably like this:
	“[css-round-display] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li><a href="#terminology"><span class="secno">2</span> <span class="content">Terminology</span></a>
    <li>
     <a href="#extending-media-queries"><span class="secno">3</span> <span class="content">Detecting the shape of the display</span></a>
     <ol class="toc">
      <li><a href="#shape-media-feature"><span class="secno">3.1</span> <span class="content">The <span class="property">shape</span> media feature</span></a>
     </ol>
    <li>
     <a href="#extending-viewport-rule"><span class="secno">4</span> <span class="content">Extending the @viewport rule</span></a>
     <ol class="toc">
      <li><a href="#viewport-fit-descriptor"><span class="secno">4.1</span> <span class="content">The <span class="property">viewport-fit</span> descriptor</span></a>
     </ol>
    <li>
     <a href="#aligning-content"><span class="secno">5</span> <span class="content">Aligning content along the display border</span></a>
     <ol class="toc">
      <li><a href="#shape-inside-property"><span class="secno">5.1</span> <span class="content">The <span class="property">shape-inside</span> property</span></a>
     </ol>
    <li>
     <a href="#drawing-borders"><span class="secno">6</span> <span class="content">Drawing borders around the display border</span></a>
     <ol class="toc">
      <li><a href="#border-boundary-property"><span class="secno">6.1</span> <span class="content">The <span class="property">border-boundary</span> property</span></a>
     </ol>
    <li><a href="#usecases"><span class="secno">7</span> <span class="content">Use Cases</span></a>
    <li>
     <a href="#changes"><span class="secno">8</span> <span class="content">Changes</span></a>
     <ol class="toc">
      <li><a href="#changes_from_March_01_2016"><span class="secno">8.1</span> <span class="content"> Changes from <span>March 1<sup>th</sup> 2016</span> version</span></a>
     </ol>
    <li><a href="#security-considerations"><span class="secno">9</span> <span class="content">Security Considerations</span></a>
    <li><a href="#privacy-considerations"><span class="secno">10</span> <span class="content">Privacy Considerations</span></a>
    <li><a href="#acks"><span class="secno">11</span> <span class="content">Acknowledgements</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li>
     <a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
     <ol class="toc">
      <li><a href="#media-descriptor-table"><span class="secno"></span> <span class="content"><span>@media</span> Descriptors</span></a>
      <li><a href="#viewport-descriptor-table"><span class="secno"></span> <span class="content"><span>@viewport</span> Descriptors</span></a>
     </ol>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
   <p>Conventionally, web pages have been shown through a rectangular screen such as PC, tablet, and smart phone. The window content area in a web browser is a rectangle. Each HTML element follows the W3C box model and thus is also a rectangle. <br> Nowadays, devices come in varied shapes of the displays.
It needs to consider the shape of the display when implementing web pages on devices.
However, current web standards lack some features to support the devices as follows:</p>
   <ol>
    <li>Lack of the capability to detect the shape of a display
    <li>Lack of layout mechanisms suitable for the shape of a display
   </ol>
    In order to facilitate the use of the web especially on a round display, there could be some features to support it. 
   <p></p>
   <p> The <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape">shape</a> media feature is added to Media Queries.
Current user agents are not capable of detecting the shape of a display so that authors cannot apply various layouts for a round display. To resolve the issue, <span class="property" id="ref-for-descdef-media-shape①">shape</span> informs the web page of the property regarding the shape of the display. <br><br> To apply the shape of a display to content area, we extend the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside">shape-inside</a> property of CSS Shapes. The position of the element which is overflowed from the display is adjusted inside the display when using this property even if the authors don’t know the exact shape of the display. <br><br> We also add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary">border-boundary</a> property to CSS Backgrounds and Borders. The borders of the element can be drawn along the edge of the display even if the element is overflowed. <br><br> </p>
   <p>This module provides features such as:</p>
   <ul>
    <li data-md>
     <p>Detecting the rounded display</p>
    <li data-md>
     <p>Aligning contents in the display’s shape</p>
    <li data-md>
     <p>Drawing borders along the display’s edge</p>
   </ul>
   <h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2>
   <p>This specification follows the CSS property definition conventions from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. <br> The detailed description of Media Queries is defined in <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a><br> The detailed description of CSS Shapes is defined in <span>[CSS-SHAPES-2]</span><br> The detailed description of Backgrounds and Borders is defined in <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a><br> The detailed description of Positioned Layout is defined in <a data-link-type="biblio" href="#biblio-css3-positioning">[CSS3-POSITIONING]</a><br></p>
   <h2 class="heading settled" data-level="3" id="extending-media-queries"><span class="secno">3. </span><span class="content">Detecting the shape of the display</span><a class="self-link" href="#extending-media-queries"></a></h2>
   <p>Media Queries <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a> define mechanisms to support media-dependent style sheets,
tailored for different environments. We propose to extend Media Queries 
by adding the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape②">shape</a> media feature to support various types of displays. 
This will allow web authors to apply different styles to a web page on the rounded display.</p>
   <h3 class="heading settled" data-level="3.1" id="shape-media-feature"><span class="secno">3.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape③">shape</a> media feature</span><a class="self-link" href="#shape-media-feature"></a></h3>
   <table class="def descdef mq">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-for="@media" data-dfn-type="descriptor" data-export id="descdef-media-shape">shape</dfn>
     <tr>
      <th>For:
      <td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media">@media</a>
     <tr>
      <th>Value:
      <td class="prod">rect <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> round
     <tr>
      <th>Type:
      <td>discrete
   </table>
   <p>Describes the general shape of the targeted display area of the output device.
It accepts the following values:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="@media/shape" data-dfn-type="value" data-export id="valdef-media-shape-rect">rect</dfn> 
    <dd> The shape is an axis aligned rectangle or square, or a similar shape 
			such as rounded rectangle for which the traditional designs are appropriate. 
    <dt><dfn class="dfn-paneled css" data-dfn-for="@media/shape" data-dfn-type="value" data-export id="valdef-media-shape-round">round</dfn> 
    <dd> The shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate. 
   </dl>
   <div class="example" id="example-8c540f42">
    <a class="self-link" href="#example-8c540f42"></a> The following examples show what <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape④">shape</a> media feature can do when the web page
	is on the various shapes of displays.
	The sample web page is a simple clock application written in HTML and seen through
	the rectangular display and the rounded display. 
    <p>In the first example, the clock application doesn’t implemented with <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape⑤">shape</a> media feature,
	so it can’t deal with different types of displays. 
	It only uses 'rectangle.css' which is designed for the rectangular display 
	no matter what the type of the display is.
	On the round display, some parts of the clock application would be clipped.</p>
<pre class="lang-html highlight"><c- cp>&lt;!DOCTYPE html></c->
<c- p>&lt;</c-><c- f>html</c-><c- p>></c->
<c- p>&lt;</c-><c- f>head</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>link</c-> <c- e>rel</c-><c- o>=</c-><c- s>"stylesheet"</c-> <c- e>href</c-><c- o>=</c-><c- s>"rectangle.css"</c-> <c- p>/></c->
<c- p>&lt;/</c-><c- f>head</c-><c- p>></c->
<c- p>&lt;</c-><c- f>body</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"clockLayer"</c-><c- p>></c->
        <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"clockLayer"</c-><c- p>></c->
            <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"date"</c-><c- p>></c->2015/02/28 (SAT)<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
            <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"time"</c-><c- p>></c->10:11<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
            <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"weather"</c-><c- p>>&lt;</c-><c- f>img</c-> <c- e>src</c-><c- o>=</c-><c- s>"cloudy.png"</c-> <c- p>/>&lt;/</c-><c- f>div</c-><c- p>></c->
        <c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
    <c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>body</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>html</c-><c- p>></c->
</pre>
    <figure>
     <div class="example-table">
      <div class="desc">
        <img alt="An image of a clock within a rectangle display" src="images/device_radius_clock_a.png"> 
       <p>(A) Rectangle Display</p>
      </div>
      <div class="desc">
        <img alt="An image of a clock within a round display" src="images/device_radius_clock_b.png"> 
       <p>(B) Round Display</p>
      </div>
     </div>
     <figcaption> Clock Application without the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape⑥">shape</a> media feature </figcaption>
    </figure>
    <p>On the other hand, in the second example, the clock application uses <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape⑦">shape</a> media feature.
	The following media queries are added to the code of the clock application from 
	the first example.</p>
<pre class="lang-html highlight"><c- c>&lt;!-- index.html --></c->
<c- p>&lt;</c-><c- f>head</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>link</c-> <c- e>media</c-><c- o>=</c-><c- s>"screen and (shape: rect)"</c-> <c- e>rel</c-><c- o>=</c-><c- s>"stylesheet"</c-> <c- e>href</c-><c- o>=</c-><c- s>"rectangle.css"</c-> <c- p>/></c->
    <c- p>&lt;</c-><c- f>link</c-> <c- e>media</c-><c- o>=</c-><c- s>"screen and (shape: round)"</c-> <c- e>rel</c-><c- o>=</c-><c- s>"stylesheet"</c-> <c- e>href</c-><c- o>=</c-><c- s>"round.css"</c-> <c- p>/></c->
<c- p>&lt;/</c-><c- f>head</c-><c- p>></c->
</pre>
    <p>If the clock application is loaded in a round display, 'round.css' which is the design for
	the round display will be applied by the Media Queries mechanism.</p>
    <figure>
     <div class="example-table">
      <div class="desc">
        <img alt="An image of a clock within a rectangle display" src="images/device_radius_clock_a.png"> 
       <p>(A) Rectangle Display<br>(when 'shape: rect' returns <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true" id="ref-for-valdef-custom-media-true">true</a>)</p>
      </div>
      <div class="desc">
        <img alt="An image of a clock within a round display" src="images/device_radius_clock_c.png"> 
       <p>(B) Round Display<br>(when 'shape: round' returns <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true" id="ref-for-valdef-custom-media-true①">true</a>)</p>
      </div>
     </div>
     <figcaption> Clock Application with the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape⑧">shape</a> media feature </figcaption>
    </figure>
   </div>
   <p class="note" role="note"> Note: So far, the only standard APIs of Operating System which exposes 
information about the display’s shape is <a href="https://developer.android.com/reference/android/content/res/Configuration.html?hl=es#isScreenRound%28%29"><span class="css">isScreenRound()</span> API</a> in Android. <a href="https://developer.android.com/reference/android/content/res/Configuration.html?hl=es#isScreenRound%28%29"><span class="css">isScreenRound()</span> API</a> returns a boolean that says round or not.<br> Refered the semantics of this API, when isScreenRound() returns <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true" id="ref-for-valdef-custom-media-true②">true</a>, <a class="css" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape⑨">shape: round</a> should evaluate
 to <span class="css" id="ref-for-valdef-custom-media-true③">true</span> and <span class="css" id="ref-for-descdef-media-shape①⓪">shape: rect</span> should evaluate to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-false" id="ref-for-valdef-custom-media-false">false</a> when isScreenRound() returns <span class="css" id="ref-for-valdef-custom-media-false①">false</span>.<br> <span class="property" id="ref-for-descdef-media-shape①①">shape</span> is dealing with 2 shapes, but it can be extended if there are the needs about
configuring other shapes from the developers. </p>
   <p class="note" role="note">Note: There are cases when the UA may know the shape even in the absence of OS APIs. 
For example, when rendering to PDF, the shape is known to be a rectangle, so 'shape: rect' evaluates to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true" id="ref-for-valdef-custom-media-true④">true</a> while <a class="css" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape①②">shape: round</a> to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-false" id="ref-for-valdef-custom-media-false②">false</a> </p>
   <h2 class="heading settled" data-level="4" id="extending-viewport-rule"><span class="secno">4. </span><span class="content">Extending the @viewport rule</span><a class="self-link" href="#extending-viewport-rule"></a></h2>
   <h3 class="heading settled" data-level="4.1" id="viewport-fit-descriptor"><span class="secno">4.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit">viewport-fit</a> descriptor</span><a class="self-link" href="#viewport-fit-descriptor"></a></h3>
   <p><a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit①">viewport-fit</a> can set the size of the visual viewport.</p>
   <table class="def descdef">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-for="@viewport" data-dfn-type="descriptor" data-export id="descdef-viewport-viewport-fit">viewport-fit</dfn>
     <tr>
      <th>For:
      <td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport" id="ref-for-at-ruledef-viewport">@viewport</a>
     <tr>
      <th>Value:
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①">|</a> contain <span id="ref-for-comb-one②">|</span> cover
     <tr>
      <th>Initial:
      <td>auto
     <tr>
      <th>Percentages:
      <td>N/A
     <tr>
      <th>Computed value:
      <td>as specified
   </table>
   <p>The initial layout viewport seen through the physical screen of the device.
On rounded screen, the part of the page that’s currently shown on-screen is round but 
the viewport is rectangular.
Because of this, depending on the size of the viewport, some part of the page may be clipped.</p>
   <figure>
     <img alt="An image of the clipped area between the viewport bounding box and the device’s border" src="images/viewport_clipped_area.png" style="width: 250px"> 
    <figcaption> Clipped area </figcaption>
   </figure>
   <p><a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit②">viewport-fit</a> can control the clipped area by setting the size of the visual viewport.</p>
   <p>Values have the following meanings:</p>
   <dl>
    <dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export id="valdef-viewport-fit-auto">auto<a class="self-link" href="#valdef-viewport-fit-auto"></a></dfn>
    <dd> This value doesn’t affect the initial layout viewport, 
		and the whole web page is viewable. 
		What the UA paints outside of the viewport is undefined. 
		It may be the background color of the canvas, or anything else 
		that the UA deems appropriate. 
    <dt><dfn class="dfn-paneled css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export id="valdef-viewport-fit-contain">contain</dfn>
    <dd> The initial layout viewport and the visual viewport are set to the largest rectangle 
		which is inscribed in the display of the device.
		What the UA paints outside of the viewport is undefined. 
		It may be the background color of the canvas, or anything else that
		the UA deems appropriate. 
    <p class="note" role="note">Note: With this value, 'border-boundary: display' and 
	'shape-inside: display' have no effect.</p>
    <dt><dfn class="dfn-paneled css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export id="valdef-viewport-fit-cover">cover</dfn>
    <dd> The initial layout viewport and the visual viewport are set to the circumscribed 
		rectangle of the physical screen of the device. 
   </dl>
   <p>When setting the size of the bounding box for the viewport on the non-rectangular display, we have to consider the factors like below:</p>
   <ul>
    <li>Clipped area which is caused because the area of the viewport bounding box is larger than the area of the display
    <li>Gap between the bounding box for the viewport and the area of the display
   </ul>
   <p>The author can decide which factor is more critical than another.
If it have to be guaranteed that any part of the web page isn’t hidden, avoiding clipping is more important than having a gap between the bounding box of the viewport and the border of the screen. If the author doesn’t want web pages to be small for the readability, then it would be better to set <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit③">viewport-fit</a> as <a href="#valdef-viewport-fit-cover" id="ref-for-valdef-viewport-fit-cover">cover</a> and to implement pages with considering the clipped parts.</p>
   <div class="example" id="example-fa1a5dd3">
    <a class="self-link" href="#example-fa1a5dd3"></a> 
    <p>This example shows the size of the bounding box for the viewport specified with <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit④">viewport-fit</a> on the rounded display.</p>
    <p>When the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit⑤">viewport-fit</a> is specified with <a href="#valdef-viewport-fit-contain" id="ref-for-valdef-viewport-fit-contain">contain</a>, the initial viewport is applied to the largest inscribed rectangle of the display.</p>
<pre class="lang-css highlight"><c- n>@viewport</c-> <c- p>(</c->viewport-fit<c- f>: contain) </c-><c- p>{</c->
    <c- c>/* CSS for the rectangular design */</c->
<c- p>}</c->      
</pre>
    <figure>
      <img alt="An image about the viewport applied to the bounding box specified with &apos;viewport-fit: contain&apos;" src="images/viewport_fit_contain.png" style="width: 300px; text-align: center"> 
     <figcaption> With '<code>viewport-fit: contain</code>' </figcaption>
    </figure>
    <p>When <a href="#valdef-viewport-fit-cover" id="ref-for-valdef-viewport-fit-cover①">cover</a> is given to the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit⑥">viewport-fit</a>, the initial viewport is applied to the circumscribed rectangle of the display.</p>
<pre class="lang-css highlight"><c- n>@viewport</c-> <c- p>{</c->
    <c- k>viewport-fit</c-><c- p>:</c-> cover<c- p>;</c->
<c- p>}</c->
<c- n>@media</c-> <c- p>(</c->shape<c- f>: round)</c-><c- p>{</c->
    <c- c>/* styles for the round design */</c->
<c- p>}</c->
<c- n>@media</c-> <c- p>(</c->shape<c- f>: rect)</c-><c- p>{</c->
    <c- c>/* styles for the rectangular design */</c->
<c- p>}</c->
</pre>
    <figure>
      <img alt="An image about the viewport applied to the bounding box specified with &apos;viewport-fit: cover&apos;" src="images/viewport_fit_cover.png" style="width: 300px; text-align: center"> 
     <figcaption> With '<code>viewport-fit: cover</code>' </figcaption>
    </figure>
   </div>
   <h2 class="heading settled" data-level="5" id="aligning-content"><span class="secno">5. </span><span class="content">Aligning content along the display border</span><a class="self-link" href="#aligning-content"></a></h2>
   <h3 class="heading settled" data-level="5.1" id="shape-inside-property"><span class="secno">5.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside①">shape-inside</a> property</span><a class="self-link" href="#shape-inside-property"></a></h3>
   <p>CSS Shapes <span>[CSS-SHAPES-2]</span> define the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside②">shape-inside</a> property that aligns contents along the edge of a possibly non-rectangular wrapping area. Web authors may use this feature to fit contents inside a round display. However, it can be challenging to specify the wrapping area to be identical to the shape of a display. To address such cases, <span class="property" id="ref-for-propdef-shape-inside③">shape-inside</span> is extended with a new value named '<code>display</code>', such an element having this value will have its content (or contained elements) aligned along the display border automatically.</p>
   <table class="def propdef" data-link-for-hint="shape-inside">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-inside">shape-inside</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③">|</a> outside-shape <span id="ref-for-comb-one④">|</span> [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape" id="ref-for-typedef-basic-shape">&lt;basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-any" id="ref-for-comb-any">||</a> shape-box ] <span id="ref-for-comb-one⑤">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image">&lt;image></a> <span id="ref-for-comb-one⑥">|</span> <code>display</code>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>auto
     <tr>
      <th>Applies to:
      <td>block-level elements
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>computed lengths for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape" id="ref-for-typedef-basic-shape①">&lt;basic-shape></a>, the absolute URI for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css2/syndata.html#value-def-uri" id="ref-for-value-def-uri">&lt;uri></a>, otherwise as specified
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animatable:</a>
      <td>as defined for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape" id="ref-for-typedef-basic-shape②">&lt;basic-shape></a>, otherwise discrete
   </table>
   <p>The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside④">shape-inside</a> property works when it is set to '<code>display</code>'.
Without using Media Queries, contents can be aligned within the display edge automatically.</p>
   <div class="example" id="example-5e958f16">
    <a class="self-link" href="#example-5e958f16"></a> 
<pre class="lang-html highlight"><c- p>&lt;</c-><c- f>style</c-><c- p>></c->
    <c- p>#</c-><c- nn>container</c-> <c- p>{</c->
        <c- k>shape-inside</c-><c- p>:</c-> <c- k>display</c-><c- p>;</c->
        // the same as circle(50% at 50%, 50%) in a regular round display
    <c- p>}</c->
    <c- p>#</c-><c- nn>green-box</c-> <c- p>{</c-> <c- k>float</c-><c- p>:</c-> <c- kc>left</c-><c- p>;</c-> <c- p>}</c->
    <c- p>#</c-><c- nn>blue-box</c-> <c- p>{</c-> <c- k>float</c-><c- p>:</c-> <c- kc>right</c-><c- p>;</c-> <c- p>}</c->
<c- p>&lt;/</c-><c- f>style</c-><c- p>></c->
<c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"container"</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>p</c-><c- p>></c->
        Some inline content
        <c- p>&lt;</c-><c- f>img</c-> <c- e>id</c-><c- o>=</c-><c- s>"green-box"</c-> <c- e>src</c-><c- o>=</c-><c- s>"green-box.jpg"</c-> <c- p>/></c->
        with a float left and float right, in a
        <c- p>&lt;</c-><c- f>img</c-> <c- e>id</c-><c- o>=</c-><c- s>"blue-box"</c-> <c- e>src</c-><c- o>=</c-><c- s>"blue-box.jpg"</c-> <c- p>/></c->
        simple box with a circle shape-inside.
    <c- p>&lt;/</c-><c- f>p</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
</pre>
    <p><br></p>
    <figure>
     <div class="example-table">
      <div class="desc">
        <img alt="A layout of web contents without shape-inside:display" src="images/shape_inside_watch_a.png" style="width: 230px"> 
       <p>(A) Without '<code>shape-inside</code>'</p>
      </div>
      <div class="desc">
        <img alt="A layout of web contents with shape-inside: display" src="images/shape_inside_watch_b.png" style="width: 230px"> 
       <p>(B) With '<code>shape-inside: display</code>'</p>
      </div>
     </div>
     <figcaption> Align the content along the display border </figcaption>
    </figure>
   </div>
   <p>This property is specially useful for complex shapes (e.g. curved, stelliform, polygonal), that wouldn’t be covered by <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape" id="ref-for-typedef-basic-shape③">&lt;basic-shape></a> (i.e. circle() or ellipse()), allowing web authors to conveniently align contents with the display edge.</p>
   <p>When a containing block is placed on one end of the display and the containing block has 'shape-inside: display', the descendant blocks of the containing block are basically put on the overlapping region between the containing block and the display area. The overlapping region’s shape is mostly complicated shape, so it’s difficult to define the shape using previous method like basic-shape. The figure 4 describes these circumstances as follows.</p>
   <figure>
     <img alt="An image of two examples to show the principle of shape-inside: display" src="images/shape_inside_a.png" style="width: 500px"> 
    <figcaption> Align the content along the display border </figcaption>
   </figure>
   <p class="issue" id="issue-8d78506c"><a class="self-link" href="#issue-8d78506c"></a> What if content overflows? Clipping or scrolling? </p>
   <h2 class="heading settled" data-level="6" id="drawing-borders"><span class="secno">6. </span><span class="content">Drawing borders around the display border</span><a class="self-link" href="#drawing-borders"></a></h2>
   <h3 class="heading settled" data-level="6.1" id="border-boundary-property"><span class="secno">6.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary①">border-boundary</a> property</span><a class="self-link" href="#border-boundary-property"></a></h3>
   <p>We add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary②">border-boundary</a> property to set a boundary constraint that affects the borders of an element.</p>
   <table class="def propdef" data-link-for-hint="border-boundary">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-border-boundary">border-boundary</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑦">|</a> parent <span id="ref-for-comb-one⑧">|</span> display
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>yes
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>discrete
   </table>
   <p>When the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary③">border-boundary</a> property on an element is set to '<code>parent</code>', additional borders of the element could be drawn where the element’s area and the borders of its parent are met. When it is set to '<code>display</code>', additional borders could be drawn where the element’s area and the borders of screen are met. The default value is '<code>none</code>', imposing no boundary constraint on the borders.</p>
   <div class="example" id="example-ad16cf24">
    <a class="self-link" href="#example-ad16cf24"></a> The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary④">border-boundary</a> property works on drawing borders. The result is shown in Figure 5B. 
<pre class="lang-html highlight"><c- p>&lt;</c-><c- f>style</c-><c- p>></c->
    <c- p>#</c-><c- nn>container</c-> <c- p>{</c->
        <c- k>border-boundary</c-><c- p>:</c-> <c- k>display</c-><c- p>;</c->
    <c- p>}</c->
    <c- p>#</c-><c- nn>redBox</c-> <c- p>{</c->
        <c- k>border</c-><c- p>:</c-> <c- mi>5</c-><c- b>px</c-> <c- kc>red</c-> <c- kc>solid</c-><c- p>;</c->
    <c- p>}</c->
    <c- p>#</c-><c- nn>greenBox</c-> <c- p>{</c->
        <c- k>border</c-><c- p>:</c-> <c- mi>5</c-><c- b>px</c-> <c- kc>green</c-> <c- kc>solid</c-><c- p>;</c->
    <c- p>}</c->
    <c- p>#</c-><c- nn>blueBox</c-> <c- p>{</c->
        <c- k>border</c-><c- p>:</c-> <c- mi>5</c-><c- b>px</c-> <c- kc>blue</c-> <c- kc>solid</c-><c- p>;</c->
    <c- p>}</c->
<c- p>&lt;/</c-><c- f>style</c-><c- p>></c->
<c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"container"</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"redBox"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"greenBox"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"blueBox"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>div</c-><c- p>></c->
</pre>
    <p><br></p>
    <figure>
     <div class="example-table">
      <div class="desc">
        <img alt="An image of circle drawing border lines without border-boundary: display" src="images/border_boundary_a.png" style="width: 200px"> 
       <p>(A) Without '<code>border-boundary</code>'</p>
      </div>
      <div class="desc">
        <img alt="An image of circle drawing border lines with border-boundary: display" src="images/border_boundary_b.png" style="width: 200px"> 
       <p>(B) With '<code>border-boundary: display</code>'</p>
      </div>
     </div>
     <figcaption> Align the content along the display border </figcaption>
    </figure>
   </div>
   <p class="note" role="note">Note: If the value of <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary⑤">border-boundary</a> is parent or display, border lines of the element are actually just a visual effect. It triggers a layout for rendering in a general way, but in the above cases (border-boundary: parent|display), the layout doesn’t occur and it only draws the border lines inward from the containing block’s borders. With this situation, the borders might hide contents around the display edge. </p>
   <h2 class="heading settled" data-level="7" id="usecases"><span class="secno">7. </span><span class="content">Use Cases</span><a class="self-link" href="#usecases"></a></h2>
   <p>Use cases are described on <a href="https://wiki.csswg.org/ideas/round-display">these</a>.</p>
   <h2 class="heading settled" data-level="8" id="changes"><span class="secno">8. </span><span class="content">Changes</span><a class="self-link" href="#changes"></a></h2>
   <h3 class="heading settled" data-level="8.1" id="changes_from_March_01_2016"><span class="secno">8.1. </span><span class="content"> Changes from <a href="http://www.w3.org/TR/2016/WD-css-round-display-1-20160301/">March 1<sup>th</sup> 2016</a> version</span><a class="self-link" href="#changes_from_March_01_2016"></a></h3>
   <ul>
    <li>Changed naming of the media query feature for detecting the shape of a display from <a href="https://www.w3.org/TR/css-round-display-1/#device-radius-media-feature"><span class="css">device-radius</span></a> to <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape①③">shape</a>.
    <li>Defined the value type of <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape①④">shape</a> as <a class="css" data-link-type="maybe" href="#valdef-media-shape-round" id="ref-for-valdef-media-shape-round">round</a> and <a class="css" data-link-type="maybe" href="#valdef-media-shape-rect" id="ref-for-valdef-media-shape-rect">rect</a>.
    <li>Added <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit⑦">viewport-fit</a> descriptor for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport" id="ref-for-at-ruledef-viewport①">@viewport</a> rule.
    <li>Removed polar positioning and Merged it into Motion Path <a data-link-type="biblio" href="#biblio-motion-1">[motion-1]</a>.<br> The element gets positioned in polar coordinate system using <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/motion-1/#propdef-offset-path" id="ref-for-propdef-offset-path">offset-path</a> with the ray function, <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/motion-1/#propdef-offset-distance" id="ref-for-propdef-offset-distance">offset-distance</a>, and <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/motion-1/#propdef-offset-position" id="ref-for-propdef-offset-position">offset-position</a>.<br> (see <a href="https://github.com/w3c/csswg-drafts/issues/214">issue #214</a>)<br> 
   </ul>
   <p>See also <a href="https://www.w3.org/TR/css-round-display-1/#changes_from_Sep_22_2015">previous changes</a>.</p>
   <h2 class="heading settled" data-level="9" id="security-considerations"><span class="secno">9. </span><span class="content">Security Considerations</span><a class="self-link" href="#security-considerations"></a></h2>
   <p>There are no known security issues introduced by these features.</p>
   <h2 class="heading settled" data-level="10" id="privacy-considerations"><span class="secno">10. </span><span class="content">Privacy Considerations</span><a class="self-link" href="#privacy-considerations"></a></h2>
   <p>There are no known privacy issues introduced by these features.</p>
   <h2 class="heading settled" data-level="11" id="acks"><span class="secno">11. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acks"></a></h2>
    This specification is made possible by input from Dong-Young Lee, Soonbo Han, Florian Rivoal, Joone Hur,
	Kang-Soo Seo, Sangjo Park, Woojun Jung, Chisoon Jeong, Yunbum Sung, Alan Stearns, Brad Kemper, and the CSS Working Group members.
	Thanks also to Adenilson Cavalcanti for editorial input. 
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#valdef-viewport-fit-auto">auto</a><span>, in §4.1</span>
   <li><a href="#propdef-border-boundary">border-boundary</a><span>, in §6.1</span>
   <li><a href="#valdef-viewport-fit-contain">contain</a><span>, in §4.1</span>
   <li><a href="#valdef-viewport-fit-cover">cover</a><span>, in §4.1</span>
   <li><a href="#valdef-media-shape-rect">rect</a><span>, in §3.1</span>
   <li><a href="#valdef-media-shape-round">round</a><span>, in §3.1</span>
   <li><a href="#descdef-media-shape">shape</a><span>, in §3.1</span>
   <li><a href="#propdef-shape-inside">shape-inside</a><span>, in §5.1</span>
   <li><a href="#descdef-viewport-viewport-fit">viewport-fit</a><span>, in §4.1</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-at-ruledef-media">
   <a href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media">https://drafts.csswg.org/css-conditional-3/#at-ruledef-media</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-at-ruledef-media">3.1. The shape media feature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-at-ruledef-viewport">
   <a href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport">https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-at-ruledef-viewport">4.1. The viewport-fit descriptor</a>
    <li><a href="#ref-for-at-ruledef-viewport①">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-basic-shape">
   <a href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape">https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-basic-shape">5.1. The shape-inside property</a> <a href="#ref-for-typedef-basic-shape①">(2)</a> <a href="#ref-for-typedef-basic-shape②">(3)</a> <a href="#ref-for-typedef-basic-shape③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">3.1. The shape media feature</a>
    <li><a href="#ref-for-comb-one①">4.1. The viewport-fit descriptor</a> <a href="#ref-for-comb-one②">(2)</a>
    <li><a href="#ref-for-comb-one③">5.1. The shape-inside property</a> <a href="#ref-for-comb-one④">(2)</a> <a href="#ref-for-comb-one⑤">(3)</a> <a href="#ref-for-comb-one⑥">(4)</a>
    <li><a href="#ref-for-comb-one⑦">6.1. The border-boundary property</a> <a href="#ref-for-comb-one⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-any">
   <a href="https://drafts.csswg.org/css-values-4/#comb-any">https://drafts.csswg.org/css-values-4/#comb-any</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-any">5.1. The shape-inside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-value-def-uri">
   <a href="https://drafts.csswg.org/css2/syndata.html#value-def-uri">https://drafts.csswg.org/css2/syndata.html#value-def-uri</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-value-def-uri">5.1. The shape-inside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-image">
   <a href="https://drafts.csswg.org/css-images-3/#typedef-image">https://drafts.csswg.org/css-images-3/#typedef-image</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-image">5.1. The shape-inside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-custom-media-false">
   <a href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-false">https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-false</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-custom-media-false">3.1. The shape media feature</a> <a href="#ref-for-valdef-custom-media-false①">(2)</a> <a href="#ref-for-valdef-custom-media-false②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-custom-media-true">
   <a href="https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true">https://drafts.csswg.org/mediaqueries-5/#valdef-custom-media-true</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-custom-media-true">3.1. The shape media feature</a> <a href="#ref-for-valdef-custom-media-true①">(2)</a> <a href="#ref-for-valdef-custom-media-true②">(3)</a> <a href="#ref-for-valdef-custom-media-true③">(4)</a> <a href="#ref-for-valdef-custom-media-true④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-offset-distance">
   <a href="https://drafts.fxtf.org/motion-1/#propdef-offset-distance">https://drafts.fxtf.org/motion-1/#propdef-offset-distance</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-offset-distance">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-offset-path">
   <a href="https://drafts.fxtf.org/motion-1/#propdef-offset-path">https://drafts.fxtf.org/motion-1/#propdef-offset-path</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-offset-path">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-offset-position">
   <a href="https://drafts.fxtf.org/motion-1/#propdef-offset-position">https://drafts.fxtf.org/motion-1/#propdef-offset-position</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-offset-position">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-conditional-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-at-ruledef-media" style="color:initial">@media</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-device-adapt-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-at-ruledef-viewport" style="color:initial">@viewport</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-shapes-2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-basic-shape" style="color:initial">&lt;basic-shape></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
     <li><span class="dfn-paneled" id="term-for-comb-any" style="color:initial">||</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS21]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-value-def-uri" style="color:initial">&lt;uri></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css3-images]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-image" style="color:initial">&lt;image></span>
    </ul>
   <li>
    <a data-link-type="biblio">[mediaqueries-5]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valdef-custom-media-false" style="color:initial">false</span>
     <li><span class="dfn-paneled" id="term-for-valdef-custom-media-true" style="color:initial">true</span>
    </ul>
   <li>
    <a data-link-type="biblio">[motion-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-offset-distance" style="color:initial">offset-distance</span>
     <li><span class="dfn-paneled" id="term-for-propdef-offset-path" style="color:initial">offset-path</span>
     <li><span class="dfn-paneled" id="term-for-propdef-offset-position" style="color:initial">offset-position</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-conditional-3">[CSS-CONDITIONAL-3]
   <dd>CSS Conditional Rules Module Level 3 URL: <a href="https://www.w3.org/TR/css3-conditional/">https://www.w3.org/TR/css3-conditional/</a>
   <dt id="biblio-css-device-adapt-1">[CSS-DEVICE-ADAPT-1]
   <dd>Rune Lillesveen; Florian Rivoal; Matt Rakow. <a href="https://www.w3.org/TR/css-device-adapt-1/">CSS Device Adaptation Module Level 1</a>. 29 March 2016. WD. URL: <a href="https://www.w3.org/TR/css-device-adapt-1/">https://www.w3.org/TR/css-device-adapt-1/</a>
   <dt id="biblio-css-shapes-2">[CSS-SHAPES-2]
   <dd>CSS Shapes Module Level 2 URL: <a href="https://drafts.csswg.org/css-shapes-2/">https://drafts.csswg.org/css-shapes-2/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css21">[CSS21]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a>
   <dt id="biblio-css3-images">[CSS3-IMAGES]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css3-images/">CSS Image Values and Replaced Content Module Level 3</a>. 17 April 2012. CR. URL: <a href="https://www.w3.org/TR/css3-images/">https://www.w3.org/TR/css3-images/</a>
   <dt id="biblio-motion-1">[MOTION-1]
   <dd>Dirk Schulze; et al. <a href="https://www.w3.org/TR/motion-1/">Motion Path Module Level 1</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/motion-1/">https://www.w3.org/TR/motion-1/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-css3-positioning">[CSS3-POSITIONING]
   <dd>Rossen Atanassov; Arron Eicholz. <a href="https://www.w3.org/TR/css-position-3/">CSS Positioned Layout Module Level 3</a>. 17 May 2016. WD. URL: <a href="https://www.w3.org/TR/css-position-3/">https://www.w3.org/TR/css-position-3/</a>
   <dt id="biblio-css3bg">[CSS3BG]
   <dd>Bert Bos; Elika Etemad; Brad Kemper. <a href="https://www.w3.org/TR/css-backgrounds-3/">CSS Backgrounds and Borders Module Level 3</a>. 17 October 2017. CR. URL: <a href="https://www.w3.org/TR/css-backgrounds-3/">https://www.w3.org/TR/css-backgrounds-3/</a>
   <dt id="biblio-mediaqueries-4">[MEDIAQUERIES-4]
   <dd>Florian Rivoal; Tab Atkins Jr.. <a href="https://www.w3.org/TR/mediaqueries-4/">Media Queries Level 4</a>. 5 September 2017. CR. URL: <a href="https://www.w3.org/TR/mediaqueries-4/">https://www.w3.org/TR/mediaqueries-4/</a>
   <dt id="biblio-mediaqueries-5">[MEDIAQUERIES-5]
   <dd>Media Queries Level 5 URL: <a href="https://drafts.csswg.org/mediaqueries-5/">https://drafts.csswg.org/mediaqueries-5/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Ani­mat­able
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary⑥">border-boundary</a>
      <td>none | parent | display
      <td>none
      <td>all elements
      <td>yes
      <td>n/a
      <td>
      <td>discrete
      <td>per grammar
      <td>specified keyword
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside⑤">shape-inside</a>
      <td>auto | outside-shape | [ &lt;basic-shape> || shape-box ] | &lt;image> | display
      <td>auto
      <td>block-level elements
      <td>no
      <td>n/a
      <td>as defined for &lt;basic-shape>, otherwise discrete
      <td>
      <td>per grammar
      <td>computed lengths for &lt;basic-shape>, the absolute URI for &lt;uri>, otherwise as specified
   </table>
  </div>
  <h3 class="no-num no-ref heading settled" id="media-descriptor-table"><span class="content"><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media①">@media</a> Descriptors</span><a class="self-link" href="#media-descriptor-table"></a></h3>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Type
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="descriptor" href="#descdef-media-shape" id="ref-for-descdef-media-shape①⑤">shape</a>
      <td>rect | round
      <td>
      <td>discrete
   </table>
  </div>
  <h3 class="no-num no-ref heading settled" id="viewport-descriptor-table"><span class="content"><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport" id="ref-for-at-ruledef-viewport②">@viewport</a> Descriptors</span><a class="self-link" href="#viewport-descriptor-table"></a></h3>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Computed value
      <th scope="col">Percentages
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="descriptor" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit⑧">viewport-fit</a>
      <td>auto | contain | cover
      <td>auto
      <td>as specified
      <td>N/A
   </table>
  </div>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> What if content overflows? Clipping or scrolling? <a href="#issue-8d78506c"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="descdef-media-shape">
   <b><a href="#descdef-media-shape">#descdef-media-shape</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-descdef-media-shape">1. Introduction</a> <a href="#ref-for-descdef-media-shape①">(2)</a>
    <li><a href="#ref-for-descdef-media-shape②">3. Detecting the shape of the display</a>
    <li><a href="#ref-for-descdef-media-shape③">3.1. The shape media feature</a> <a href="#ref-for-descdef-media-shape④">(2)</a> <a href="#ref-for-descdef-media-shape⑤">(3)</a> <a href="#ref-for-descdef-media-shape⑥">(4)</a> <a href="#ref-for-descdef-media-shape⑦">(5)</a> <a href="#ref-for-descdef-media-shape⑧">(6)</a> <a href="#ref-for-descdef-media-shape⑨">(7)</a> <a href="#ref-for-descdef-media-shape①⓪">(8)</a> <a href="#ref-for-descdef-media-shape①①">(9)</a> <a href="#ref-for-descdef-media-shape①②">(10)</a>
    <li><a href="#ref-for-descdef-media-shape①③">8.1. 
Changes from March 1th 2016 version</a> <a href="#ref-for-descdef-media-shape①④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-media-shape-rect">
   <b><a href="#valdef-media-shape-rect">#valdef-media-shape-rect</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-media-shape-rect">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-media-shape-round">
   <b><a href="#valdef-media-shape-round">#valdef-media-shape-round</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-media-shape-round">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="descdef-viewport-viewport-fit">
   <b><a href="#descdef-viewport-viewport-fit">#descdef-viewport-viewport-fit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-descdef-viewport-viewport-fit">4.1. The viewport-fit descriptor</a> <a href="#ref-for-descdef-viewport-viewport-fit①">(2)</a> <a href="#ref-for-descdef-viewport-viewport-fit②">(3)</a> <a href="#ref-for-descdef-viewport-viewport-fit③">(4)</a> <a href="#ref-for-descdef-viewport-viewport-fit④">(5)</a> <a href="#ref-for-descdef-viewport-viewport-fit⑤">(6)</a> <a href="#ref-for-descdef-viewport-viewport-fit⑥">(7)</a>
    <li><a href="#ref-for-descdef-viewport-viewport-fit⑦">8.1. 
Changes from March 1th 2016 version</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-viewport-fit-contain">
   <b><a href="#valdef-viewport-fit-contain">#valdef-viewport-fit-contain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-viewport-fit-contain">4.1. The viewport-fit descriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-viewport-fit-cover">
   <b><a href="#valdef-viewport-fit-cover">#valdef-viewport-fit-cover</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-viewport-fit-cover">4.1. The viewport-fit descriptor</a> <a href="#ref-for-valdef-viewport-fit-cover">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-inside">
   <b><a href="#propdef-shape-inside">#propdef-shape-inside</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-inside">1. Introduction</a>
    <li><a href="#ref-for-propdef-shape-inside①">5.1. The shape-inside property</a> <a href="#ref-for-propdef-shape-inside②">(2)</a> <a href="#ref-for-propdef-shape-inside③">(3)</a> <a href="#ref-for-propdef-shape-inside④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-border-boundary">
   <b><a href="#propdef-border-boundary">#propdef-border-boundary</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-border-boundary">1. Introduction</a>
    <li><a href="#ref-for-propdef-border-boundary①">6.1. The border-boundary property</a> <a href="#ref-for-propdef-border-boundary②">(2)</a> <a href="#ref-for-propdef-border-boundary③">(3)</a> <a href="#ref-for-propdef-border-boundary④">(4)</a> <a href="#ref-for-propdef-border-boundary⑤">(5)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>